<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		window.onload = function(){

			var gen2 =	gen();
			console.log(gen2);
			console.log(gen2.next());

			add();
		}

		function* gen() {
			yield 123 + 456;
		}

		function add(){
			alert(3);
		}

		//没有yield 只是一个暂缓函数
		function* f(){
			console.log('ok');
		}

		var print = f();

		setTimeout(function(){
			print.next();
		},2000);
	</script>
</head>
<body>
	
</body>
</html>